package com.sz.biz.pay.constants;

import com.sz.common.base.dao.ext.IEnum;

/**
 * Function: 订单的支付状态 <br>
 * Author: 陈朝晖 <br>
 * Date: 2017-11-22 17:03:00
 */
public enum PayStatus implements IEnum {

    /**
     * 未支付
     * 已支付
     * 申请退款
     * 已退款
     */
    UNPAID("201", "未支付"),
    PAID("202", "已支付"),
    APPLY_FOR_REFUND("203", "申请退款"),
    REFUND("204", "已退款");


    private String code;
    private String name;

    PayStatus(String code, String name) {
        this.code = code;
        this.name = name;
    }

    @Override
    public String getCode() {
        return this.code;
    }

    @Override
    public String getName() {
        return this.name;
    }

    public static PayStatus valueOfEnum(String code) {
        PayStatus[] iss = values();
        for (PayStatus cs : iss) {
            if (cs.getCode().equals(code)) {
                return cs;
            }
        }
        return null;
    }


}
